package com.xyy.saas.payment.config;

import com.xyy.saas.payment.cores.enums.BusinessOrderTypeEnum;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: wuqiongda
 * @Date: 2020/3/3 14:33
 */
@Component
@DependsOn({"ykqWxConfig","ykqAliConfig"})
public class ConfigMap implements InitializingBean {

    @Autowired
    public YkqWxConfig ykqWxConfig;
    @Autowired
    public YkqAliConfig ykqAliConfig;

    public Map<String, WxConfig> wxMap = new HashMap<>();
    public Map<String, AliConfig> aliMap = new HashMap<>();

    public WxConfig getWxConfig(String key){
        return wxMap.get(key);
    }
    public AliConfig getAliConfig(String key){
        return aliMap.get(key);
    }

    @Override
    public void afterPropertiesSet() throws Exception {
//        wxMap.put(BusinessOrderTypeEnum.YIKUAIQIAN_DOC.getType(), ykqWxConfig);
//        aliMap.put(BusinessOrderTypeEnum.YIKUAIQIAN_DOC.getType(), ykqAliConfig);
    }
}
